home *** CD-ROM | disk | FTP | other *** search
- Path: goanna.cs.rmit.EDU.AU!not-for-mail
- From: rav@goanna.cs.rmit.EDU.AU (++ robin)
- Newsgroups: comp.lang.pl1,comp.lang.c
- Subject: Re: PL/I and C
- Date: 26 Feb 1996 16:54:07 +1100
- Organization: Comp Sci, RMIT, Melbourne, Australia
- Message-ID: <4grhtv$s31@goanna.cs.rmit.EDU.AU>
- References: <4gh5ru$eng@goanna.cs.rmit.EDU.AU> <312CCEB2.4AB7@corp.dialog.com>
- NNTP-Posting-Host: goanna.cs.rmit.edu.au
- X-Newsreader: NN version 6.5.0 #0 (NOV)
-
- Paul Gorodyansky <paul_gorodyansky@corp.dialog.com> writes:
-
- >Mike Presseller <mpressel@research.westlaw.com> wrote:
- > > I am in the process of evaluating the development of Mainframe
- > > applications using C/370 and PLI under MVS.
-
- > For the jobs you mentioned:
- > > text conversions, database maintenance and development,
- > > and other I/O intensive routines
- > PL/I is MUCH better (I am talking about mainframe):
-
- > I. Text Processing.
- > ---------------
- > C does not have so extensive Text Processing built-in functions,
- > as PL/I does. Moreover, C has this STUPID limitation - a 'string'
- > in C it's a set of bytes with x'00' at the end ! But, we have
- > x'00' all over our source data ! It's the same symbol as any other,
- > there is nothing special in it. So, I HAD TO write myself ALL
- > string functions (sub-string, search,..) using BUFFERS, because I
- > was not able to use C 'String' functions. Obviously, functions
- > written by me are not so efficient as Built-in functions,
- > so the productivity suffers.
- > Also, C does not have Variable Length strings.
- > Again, PL/I has BUILT-IN, effective string functions.
-
- ---The basic operations of string-handling are done somewhat
- clumsily in C -- catenation is a simple infix operation
- in PL/I, but you must use a function in C, and then it
- catentates the second operand to the first. Nothing like
- c = d || e;
- (And what happens when, in strcat(s1, s2), the sum of the lengths
- of s1 and s2 exceeds the declaration for s1?!?!?
-
- ---again, for comparison, IF s1 > s2 THEN . . . becomes
- strcmp(s1, s2) . . . which yields neg, 0, or pos . . .
- which leads to IF strcmp(s1, s2) > 0 . . .
- which is scarcely intuitive [shades of the arcane FORTRAN
- arithmetic IF].
-
- I'd agree with the statement about built-in functions.
- PL/I for AIX and OS/2 now have BIFs for searching for specific
- characters (SEARCH) either from the right or from the left,
- searching for the absence of specififc characters (VERIFY)
- from the right or left.
-
- Furthermore INDEX, SEARCH, SEARCHR, VERIFY and VERIFYR
- can start the search at any specified position (the three-
- argument versions).
-
- There are several functions for centering text, & trimming
- given characters from either or both ends of a string.
-
- And what happens when you actually w*a*n*t a zero byte in your
- C character string?
-
- >Paul Gorodyansky mailto:paul_gorodyansky@corp.dialog.com
-